package com.spring.utils.api_v4.controller.ui;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spring.utils.api_v4.util.DoubleSerialize;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;

/**
 * 工资任务表单
 */
@Data
@ToString
public class TaskForm {
    @NotEmpty(message = "请填写名称")
    private String name;        // 名称
    @NotEmpty(message = "请填写说明")
    private String note;        // 说明
    @NotEmpty(message = "请选择任务类型")
    private String taskType;    // 任务类型
    @JsonSerialize(using = DoubleSerialize.class)
    private double totalWage;   // 工资总额
    private List<DeptTaskForm> taskDepts = new ArrayList<>();

    @Data
    @ToString
    @NoArgsConstructor
    public static class DeptTaskForm {
        private int id;
        private double totalWage;
        private String note = "无";
    }
}
